#include <iostream>
using namespace std;
#include "OverLoadingArray.h"

int main(int argc, char** argv) 
{
	Array integers1(3);
	Array integers2(4);
	const Array z(5);
	//测试初始化 
	cout << "Size of array integers1 is:" << integers1.getSize() << "\n"
			<< "Array after initial is:\n" << integers1;
	
	cout << "Size of array integers2 is:" << integers2.getSize() << "\n"
			<< "Array after initial is:\n" << integers2 << "\n";
	
	//测试输入 
	cout << "Input 7 integers:" << "\n";
	cin >> integers1 >> integers2; 
	cout << "After inpur,the arrays contanin:" << "\n"
		 << "Integers1:\n" << integers1 << "\n"
		 << "Intergers2:\n" << integers2 << "\n";
	
	//测试！=
	cout << "The result of integers1!=integers2 is" << "\n";
	if(integers1 != integers2)
		cout << "True" << "\n";
	else 
		cout << "False" << "\n";
	
	//测试构造复制函数
	Array integers3(integers1);
	cout << "Size of integers3 is:" << integers3.getSize() << "\n"
		 << "After initial integers3 is:\n" << integers3;
	
	//测试赋值操作
	cout << "Assigning integers2 to integers1:" << "\n";
	integers1 = integers2;
	cout << "Integers1:\n" << integers1 << "\n"
		 << "Integers2:\n" << integers2 << "\n";
	//测试==
	cout << "The result of integers1==integers2 is:" << "\n";
	if(integers1 == integers2)
		cout << "True" << "\n";
	else 
		cout << "False" << "\n";
	//测试下标1
	cout << "integers1[1] = " << integers1[1] << "\n";
	cout << "Assigning 100 to integers1[1]" << "\n";
	integers1[1] = 100;
	cout << "After assigning integer[1] = " << integers1[1] << "\n";
	cout << "Attempt to assign 100 to integers1[15]" << "\n";
	//integers1[15] = 100;
	//测试常量对象
	cout << "Const object is z[3]=" << z[3] << "\n";
	return 0;
}
